import Vue from 'vue';
import Router from 'vue-router';
Vue.use(Router);

let routes = [{
    path: '/',
    name: 'layout',
    component: () => import('@/views/layout.vue'),
    redirect: {
        name: 'jsplumb'
    },
    children: [{
            path: '/jsplumb',
            name: 'jsplumb',
            meta: {
                title: 'jsplumb案例',
            },
            component: () => import( /* webpackChunkName: "login" */ '@/views/jsplumb/jsplumb.vue')
        },
        {
            path: '/mxgraph',
            name: 'mxgraph',
            meta: {
                title: 'mxgraph例子',
            },
            component: () => import( /* webpackChunkName: "login" */ '@/views/mxgraph/mxgraph.vue')
        },
        {
            path: '/workFlow',
            name: 'workFlow',
            meta: {
                title: '工作流程',
            },
            component: () => import( /* webpackChunkName: "login" */ '@/views/workFlow/workFlow.vue')
        },
        {
            path: '/tableInput',
            name: 'tableInput',
            meta: {
                title: '表输入',
            },
            component: () => import( /* webpackChunkName: "login" */ '@/views/tableInput/tableInput.vue')
        },
        {
            path: '/freeTable',
            name: 'freeTable',
            meta: {
                title: '封装表格组件',
            },
            component: () => import( /* webpackChunkName: "login" */ '@/views/freeTable/freeTable.vue')
        },
        {
            path: '/formAutoRender',
            name: 'formAutoRender',
            meta: {
                title: '表单组件自动渲染',
            },
            component: () => import( /* webpackChunkName: "login" */ '@/views/formAutoRender/formAutoRender.vue')
        }
    ]
}]

let router = new Router({
    mode: 'history', //去掉url中的#
    routes
});

export default router;